]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-glsl-quad: Set the pipeline blend string explicitly
authorRui Matos <tiagomatos@gmail.com>
Sat, 3 Oct 2015 19:21:24 +0000 (21:21 +0200)
committerRui Matos <tiagomatos@gmail.com>
Thu, 8 Oct 2015 16:27:07 +0000 (18:27 +0200)
The default pipeline color is opaque white and blending is turned
off. If we only draw with that color (e.g. because animations are
disabled and we're always drawn with opacity == 255), blending is kept
disabled since cogl_pipeline_set_color() returns early if the color
doesn't change from what was there before.

In our case we always want blending to be enabled which we can achieve
by setting the blending string ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=755827

src/shell-glsl-quad.c

index b24f0ce804affba988026332b49f57c821726ba7..21652d1c4264eb68036c56f9bdbe67cb3a43f176 100644 (file)
@@ -139,6 +139,7 @@ shell_glsl_quad_constructed (GObject *object)
   if (G_UNLIKELY (klass->base_pipeline == NULL))
     {
       klass->base_pipeline = cogl_pipeline_new (ctx);
+      cogl_pipeline_set_blend (klass->base_pipeline, "RGBA = ADD (SRC_COLOR * (SRC_COLOR[A]), DST_COLOR * (1-SRC_COLOR[A]))", NULL);
 
       if (klass->build_pipeline != NULL)
         klass->build_pipeline (self);